package test.abstracClassTest;

import java.sql.Connection;

/**
 * 数据库链接抽象类
 */
public abstract class AbstractDataBaseClass {

    /**
     * 注册驱动
     */
    public abstract void registerDriver();

    /**
     * 获取链接
     * @return
     */
    public abstract Connection getConnection();

    /**
     * 执行sql
     */
    public abstract void  executeSql();

    public void execute(){
        this.registerDriver();
        this.getConnection();
        this.executeSql();
    }
}
